package com.uzhie.jt808.jt1078.entity.param8103;

import com.uzhie.jt808.JT808MsgBody;
import com.uzhie.jt808.msg.entity.MyBuffer;

/**
 * Created by zhangdequan on 2018/8/14.
 */
public class JT_8103_param_storge_setting  implements JT808MsgBody {

    //存储流编码格式
    private byte storge_code_mold;
    //存储流分辨率
    private byte storge_ratio;
    //存储流关键帧间隔
    private short storge_rate_interval;
    //存储流目标帧率
    private byte storge_frame_rate;
    //存储流目标码率
    private int storge_bit_rate;
    //OSD字幕叠加设置
    private short subtitle_setting;
    //是否启用音频输出ø
    private byte is_enable_audio;

    public byte getStorge_code_mold() {
        return storge_code_mold;
    }

    public void setStorge_code_mold(byte storge_code_mold) {
        this.storge_code_mold = storge_code_mold;
    }

    public byte getStorge_ratio() {
        return storge_ratio;
    }

    public void setStorge_ratio(byte storge_ratio) {
        this.storge_ratio = storge_ratio;
    }

    public short getStorge_rate_interval() {
        return storge_rate_interval;
    }

    public void setStorge_rate_interval(short storge_rate_interval) {
        this.storge_rate_interval = storge_rate_interval;
    }

    public byte getStorge_frame_rate() {
        return storge_frame_rate;
    }

    public void setStorge_frame_rate(byte storge_frame_rate) {
        this.storge_frame_rate = storge_frame_rate;
    }

    public int getStorge_bit_rate() {
        return storge_bit_rate;
    }

    public void setStorge_bit_rate(int storge_bit_rate) {
        this.storge_bit_rate = storge_bit_rate;
    }

    public short getSubtitle_setting() {
        return subtitle_setting;
    }

    public void setSubtitle_setting(short subtitle_setting) {
        this.subtitle_setting = subtitle_setting;
    }

    public byte getIs_enable_audio() {
        return is_enable_audio;
    }

    public void setIs_enable_audio(byte is_enable_audio) {
        this.is_enable_audio = is_enable_audio;
    }

    @Override
    public byte[] WriteToBytes() {
        MyBuffer buffer = new MyBuffer();
        buffer.put(getStorge_code_mold());
        buffer.put(getStorge_ratio());
        buffer.put(getStorge_rate_interval());
        buffer.put(getStorge_frame_rate());
        buffer.put(getSubtitle_setting());
        buffer.put(getIs_enable_audio());
        return buffer.array();
    }

    @Override
    public void ReadFromBytes(byte[] body) {
        MyBuffer buffer = new MyBuffer(body);
        //存储流编码格式
        setStorge_code_mold(buffer.get());
        //存储流分辨率
        setStorge_ratio(buffer.get());
        //存储流关键帧间隔
        setStorge_rate_interval(buffer.getShort());
        //存储流目标帧率
        setStorge_frame_rate(buffer.get());
        //存储流目标码率
        setStorge_bit_rate(buffer.getInt());
        //OSD字幕叠加设置
        setSubtitle_setting(buffer.getShort());
        //是否启用音频输出
        setIs_enable_audio(buffer.get());
    }
}
